[fix bug 896961] Add base JS unit tests for bedrock global.js

So I started writing some base JS unit tests for some of the stuff in `/media/js/base/global.js`,

This is by no means complete or exhaustive, but it's a starting point at least...

Currently the tests are written using [Jasmine](http://pivotal.github.io/jasmine/) using it's own in-browser spec runner, but we could switch to using a node-based runner (or something else entirely). For some of my own stuff I've been experimenting with [Karma](http://karma-runner.github.io/0.8/index.html), hooking it up to Travis CI.

Anyway, have a poke around - open to suggestions.

You can run the tests by loading `/media/js/test/tests.html`