Move init js code to startup.js.

And simplify the numberOfLeadingZeros workaround.
Add support for the optimized version in chat example.

chatExampleScalaJS/optimizeJS must be launched explicitly
before running the Play server. The optimized version is
served at /opt.