JSLint-ified - fixed almost every JSLint error