rework generated JS code to depend allow use of node's require()