Fixing the JavaScript Mess