Fix globals, spacing, JSLint