port rest of dom.js (non-working)
wip