Refactored out the creation of the canvas element into the library
itself