branchcache: move loading of branch names and nodes into it's own function
This will help me in implementing lazy loading of the branchcache in upcoming
patches.
Differential Revision: https://phab.mercurial-scm.org/D6023
local test passed
addgroupcopy test passed
clone test passed
lowlevelcopy test passed
slicing test passed
issnapshot test passed
findsnapshot test passed