Last of the JS tweaks

Part II of docblock, formatting and some general cleanup, including removal of old calls and depreciated syntax or functions.   Converted a couple of areas to class functions, and quite a few == to === to avoid senseless type casting (most not all, tried to be safe here but there could be a small number of these that were masking errors)