Updates for Grunt 0.4.0

Changes are based on @bdougherty fork, plus version updates and fixes for unit tests.