Minor tweaks to JavaScript coding style
Added class properties
Improved encapsulation of methods & removed unnecessary parameter passing