fix indentation, whitespace, semicolons, globals

(Ran JSHint)