Fixes the javascript loader so that it will work with files loaded from a file.

This is needed so that qUnit tests can run. Otherwise the relative protocol attempts to load everything from file://.

MJ-589

All tests pass.