refactoring js to oo in progress
Completed refactoring of js to oo style