Improved importJson function with hopefully more robust file writing.  Now using fs.writeFile() and lots of error checking.  Fixes issue 1.