Minor reorganization.

Organized main loop components, start screen, gameover and win screens,
etc. into functions. This will make new games easier.