updated traversing.js to support new DOM API