Offloaded the gfx library to its own module.