Moved game engine into separate file.