Grunt build

I've been doing some work on a grunt build, and thought I'd share the work in progress.

I've started out by adding some basic minification, linting and automated testing.

The minification currently outputs to a build directory, which is excluded from git. This makes it possible to do a build then copy the minified files to the correct distribution location when desired.

The lint currently fails, but I have been working on fixes for appframework.js (initially). I have another branch with a version of appframework.js which passes the linter, but I don't feel confident that my changes haven't broken anything.

So the final step was to add an automated test suite, which also runs continuous integration builds via travis-ci. So far this has poor test coverage, but I can work more on that tomorrow. The idea is that I write tests to cover the functions which I've modified during "lint fixing", which should pass on the unlinted appframework.js. Then I can put my linted appframework.js in and see whether the tests still pass.

The automated tests use a node implementation of the DOM called domino, with mocha as the test runner, integrated with grunt via grunt-mochaccino (which I wrote for another project), and using blanket for coverage. You can produce coverage reports by running <code>grunt mochaccino:cov</code>, if you're interested (coverage with the tests I've written so far is 17%).

Anyway, I thought it was worth making a pull request, as this work currently doesn't touch the core files, just adds some more infrastructure around them. I'm not desperate for it to be merged, but thought you might like to see my ideas about the direction we could take this.