Lots of cleanup - post JSLint