Added toDataURL() methods to paper and element. Extracted element methods as module.