Fix JSLint errors and remove cruft