Cleanup JS indentation and fix global

This is why using a single `var ` declaration with commas can bite you! ;-)