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

* a few forgottons semicolons
* a few forgotten "new" invocations
* globals definition for JSHint
oops, just saw, the branch needs rebasing before anyway...