fixes minor code problems, such as missing semicolons, etc.

* a few forgottons semicolons
* a few forgotten "new" invocations
* globals definition for JSHint
Yes, it tells JSHint that these symbols exist in the global namespace