For the migration to Gadgets 2.0 we need to be able to rename JavaScript and CSS pages without compromising the integrity of module loading. The raw redirect content for JavaScript pages is a mw.loader.load() for the action=raw url, however such request is asynchronous so the module would be ready (and dependants fired) before the actual scripts have been loaded.
Prevent that by making the WikiModule class resolve redirects.