Move the game loop to its own thread.
This should make it easier to separate out input and drawing routines.