fixing tree to no longer use Doc.children, also removing Doc.children