Use grunt.file.mkdir instead of mkdirp
Use grunt.file.write() for writing JSON