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

* a few forgottons semicolons
* a few forgotten "new" invocations
* globals definition for JSHint