Add trace hooks for Window and Document, and remove explicit rooting … …
…for the root DOM node. Fixes #901.