Remove long deprecated Repo.ref and Repo.revision_history.
Remove long deprecated Tree.entries.
Use new style exception handling in a few more places.