Game loop

Clean up code. Commencing division of project into proper server/client/api projects.