Add Repository#resolve which follows references to objects

It can be used in places where a specific object type is expected
but a label or other type of object id is provided.