Implement CreateTreeFromIndex on ObjectDatabase

When performing low-level operations against the repository, we
sometimes need to create a tree object from a temporary index.  Add
support to the object database API for tree creation.