Update dom.js documentation and refactor traversal functions into traversing.js