JS: Refactor, upgrade and integrate grunt-contrib-wikimedia code.

Tasks and package.json imported from:
 https://gerrit.wikimedia.org/r/p/integration/grunt-contrib-wikimedia.git

In the process, also:
* Update JSHint from 0.9.1 to 1.0.0
* Update gruntjs from 0.4.0-alpha to 0.4.0
* Update grunt-contrib-qunit from 0.1.0 to 0.2.0
* Add grunt-cli (used to be part of gruntjs)

Change-Id: If63bc23985e508dc5f15e6713e3c7a47a184da00