Lots more game logic and some cleanup.