Server-side DOM implementation based on Mozilla's dom.js