Closes #30. This is a basic refactoring of the graphics module, so everything won't be in single file.