Added canvas support

There was a  slightlybetter way of doing lines 434-440 that worked in all browsers [tested using the debugOverlay] - but it broke some of the tests and it's late so I went with the slightly more verbose method. Let me know what you think :)