More cleanup of the javascript subsystem