Added support for pausing the game
Refactored event handling to be more functional

on_event now returns an action to run rather than running it.
That fixes issues with a state change from one handler improperly
enabling another handler.