The bubble memory alarm (901) might clear up if you try the bubble memory initialization procedure. Try this:
Note: this procedure will likely erase all your parameters, part programs, tool offsets, and PC parameters. I sure hope you have these recorded somewhere. If not, maybe another forum member with the same machine has them recorded and can e-mail you some files.
1) With the power off, remove the bubble memory board and look for a sticker that gives a bunch of 3-digit numbers. These are "Defective loop" numbers for that board's bubble device. Depending on how big of a memory you have, you may have anywhere from 1 to 4 separate bubble devices, so there may be more than one set of numbers. Write down all the numbers for device 1, device 2, etc. and reinstall the board.
2) Hold the minus (-) and the decimal (.) point button while you turn the power on. That should pop up an "IL" mode screen with 6 choices
3) Press "4" for "Bubble", then "2" for "Write by manual". You will get a message "Make BMU switch on".
4) On the main "master" board, look for a toggle switch labeled "BMU Free mode" and turn it on.
5) You should then be able to enter the 3-digit numbers for "device 1", pressing INPUT each time. When all the numbers for device 1 are entered, press the START key to write those numbers to the device. If you have more than one bubble device, you will then be able to enter the numbers for each device in turn. Each time you press START, there may be a several second delay while the control writes to the bubble device
6) If any alarms happen while performing this procedure, press RESET and you can start over. After all the defective loop data is entered, you will have to power down, power back up again, then you'll have to reload all your bubble data (Parameters, tool offsets, part programs, PC parameters, etc.)
If the BMU initializes OK, that will at least get you past the "901" alarm condition. Be sure to turn off that BMU free mode switch!
Now, for the W axis E-stop:
Each axis will have a pair of limit switches that will put the control into E-stop if the control were to run past the normal overtravel alarm switches. These are extra "Safety" switches to prevent the servo from damaging the ballscrew if the servo should go nutty and run away. Look for a loose wire to one of these switches, or look for a broken wire inside a cable duct. The fact that this alarm happened while you were moving the W axis tells me that one of these switches is actuated, filled with coolent, or that you maybe have a broken or loose wire. The E-stop circuit in the system 6 is one long "chain" circuit, with a lot of things in the chain. All the axes have safety overtravel switches, and you probably have other switches or relays that can put the control into E-stop (besides the big red button). ANY ONE of those things break the +24v E-stop chain and will shut down the servos. On many machines, it turns off the hydraulics as well.
You can take a voltmeter and check for +24v at every safety switch. You should see +24v on both sides of the switch if the switch is closed. If you see nothing on either side, then the chain is broken "upstream" somewhere. Finding out what all the things are in the chain (and in what order) would require the schematics for your machine from Mazak.