Fixed formatting in client JS files.

Also replaced '==' with '===' and similar where possible, and fixed some missing
documentation.