Lots of style fixes for JavaScript
Move types inside our namespace to avoid polluting globals. Make some private.
Whitespace for strict linting.
Lint cleanup for tests