Encapsulate and provide proper support for AMD/requirejs