Moved game loop to main class.