state and event management

fixed missing calls to activate and deactivate
handlers in state manager. readded event manager
debug messages. changed logic in main menu to
be event driven instead of polling for input.