added support for AMD/requirejs