Clean up JSHint errors and whitespace