Fix some details. Also add --script parameter so that
we can use the script to generate only the require js
for debugging