Add AMD defition in core JavaScript

This commit adds support for AMD libraries like RequireJS and concepts as CommonJS. If these concepts are not used within your project the polyfill's object is exposed to the global scope.

Also fixes of inconstant white space.