Bug fixes for keyboard handling

Was referring to a non-existent 'globals' object, a leftover from before
the v2 refactoring.

Also I'd left out the 'var' keyword in some loops so was accidentally
creating a global variable.
Add keycodes for ENTER and SPACE.
Don't throw away extra methods in StateMachine.addState

The addState method was only copying the update(), enter() and leave()
methods from kwargs, so there was no way to add the draw() method
expected by the game state machine (from gameloop.js).

Changed it so that if there is a kwargs object, we use it instead of just
copying bits of it over. This feels slightly less robust, but it fixes the bug.
Update the README.
Add the beginnings of an example game.

This is an initial commit of the game code and it's nowhere near a
complete game yet. It only has loading and menu states (and the loading
state is just a simulation!). But it's a start, at least...