jsHint fixes and cleanup
passing window and document into the context is not needed
Converted to proper javascript class pattern
Syntax fixes
Removed some usage of base