refactored formatter and validator to a single jsontohtml module
write file now returns a promise