Introduce repository.Ref type
type.EmptyHash() code improvement