Moved all the drawing functions into a canvas object. Also implemented caching and better wrapping logic. Still need to apply the changes to the windows project files and debug on windows.