Refactor GraphicsEngine code into separate modules.