Hard code ELEMENT_NODE and TEXT_NODE

Earlier versions of IE do not have `ELEMENT_NODE` and `TEXT_NODE`
defined on `document`.