Centralize the creation of objects

Calling the newXFromC lets us make sure we're setting up the
finalizer.

As a bonus, get rid of TreeLookup, as it's superseded by
Repository.LookupTree.
Introduce Repository.LookupObject()

This returns an Object interface, which we can use to look up an
object when we don't know what parituclar type it has.