build.sh: added unique filename handling.
build.sh: added some manual optimizations for js.