Replace main() with start(), plus bugfixes

Instead of a zero-arg main method now, we export a method called start
which takes an initial state name as an argument. This fixes a bug where
you got a null reference error on startup because you were trying to
change out of a null state.

There were also a few copy-n-paste errors left behind: references to
'game' rather than 'globals' and a few other typos.