Bug 1109630 - Improve and Refactor grunt system

var config = JSON.parse(grunt.file.read(configFile));

And then all of those replaces should just be changing the value of a property
 then do a JSON.stringify on the write and you're golden...