Add support for AMD loading

Add support for AMD loading so querystring can be used from requirejs.