Updated to work correctly with Dojo and relative.

- Now functions correctly with relative paths.
- Works properly with Dojo.
- Fixed remaining tests to be accurate.