Moved event handler registration before the main game loop.

Title says it all.  I'll merge in a bit if no one has any objections.