Add 'outputDirPath' and 'done' parameters to main(...) function.
build(...) function now overwrites and renames its input file.
transform(...) function uses mv instead of fs.rename.
Whitespace cleanup.