Pure JavaScript moveFile function for node.js