refactor our the graphics context code, simplify
Merge pull request #9 from jwilling/refactor-graphics-context

Refactoring of graphics context code