refactor revtree & versiondocument classes