Fix for usage with Polymer Platform

As well as inside of Web Components, and generally code is more correct than previous.
Also, this is a fix for https://github.com/kangax/fabric.js/issues/1712