added functions to write minified js to a file