Reworked most of the graphics framework