Clean up Javascript code using JSLint