Code cleanup

It's as clean as it can be without making classes for handling game play, event handling and rendering. Time to merge back.