Added emergency stop flag and functionality

The emergency stop flag can be set/cleared from either the b/n keyboard
buttons or the ES/ER commands.