Fixes #5090: Possible to register js as shimmed AMD module

Some caveats:

* If you do not specify an "exports" value, RequireJS will load and run the script even if it has already been loaded on the page in the traditional fashion.
* Setting "exports" to "jQuery.fn.pluginName" does not work. It must be the name of a top-level global variable.
* Shimming does not work with legacy simplecache views right now because their urls do not end in ".js" anymore, which RequireJS expects.