Fix style in all .js files

Reviewed style in all .js files

* Added documentation to methods where
needed
* Fixed spaces and capitalisation in
method documentation
* Chained variable definitions in
module import statements

Change-Id: Ibfb8e5c8768f435ad58d3ea26381948e716f747f