Fix build environment

When I run `grunt`, I see `jshint` errors galore.

When I fix the `jshint` errors, I see QUnit errors. It seems the Gruntfile is wired for testing, but the test environment was never set up.

When I fix that too (and write a solitary unit test), everything works.

So I've done all that. Here it is :).