moved game loop and flow into separate files so I can benchmark them better
minor cosmetic changes