Unit tests not working with PhantomJS

I have made some changes to get around a limitation of PhantomJS for unit tests. PhantomJS currently doesn't support `bind` on Function.prototype (https://github.com/ariya/phantomjs/issues/10522). It appears as though, the cleanest workaround is to include an es5 shim for testing purposes.

I also ran gjslint and found a few issues with the syntax. It is still complaining about the `@example` annotations but I couldn't see a problem with it.