JSLint and code cleanup