Refactor implementation

Refactor the Graphics and Input and Game classes so that complex peices of
code are put in their own methods.