Create dom.js

each function is (should be) autonomous