Made a bunch of changes to web.js, hopefully it works.