[CB-4420] Add a helper function for resolving relative URLs.

Note that the tests required a newer version of jsdom.
Change Gruntfile to auto-build before running tests
Make base64 tests work in browser as well as Node
[CB-4419] Remove non-CLI platforms from cordova-js.

They live on in the 2.9.x branch.