added a flush flag that dumps the js to out
added a flush flag