Refactored the graphics package a bit.