Clean up stuff for javascript modes