MDL-20636 Finish making ddwtos work, mostly. Also various other JS fixes.