Added document node and fixed up broken unit tests.