Some semi-hacked up gameloop-stuff.  Not working. very messy.
Some reformatting and also remove paint code that isn't used in the gameloop model.