Implement hash() in Object to avoid duplicates in sets etc.

The hash value is a combination of the object UUID, its class name
and the tree SHA1 of the object directory.