Make the JS more sane and less just-compiled-from-CS.