Remove ?factory parameter where it's not really needed.
Introduce top-level resolveRef function.
A function to get the tree by commit reference.