Beautify JS in modules

* Used js-beautify tool.
* JS coding standards as per MediaWiki.
* Fixed indentation 'by hand' where js-beautify fails.

Change-Id: I1e92efdf70ff47e0c31ca7ffc1098dea5bac0aee