Extract the cache manager instantiation to a method

This will allow people to easily override this. For example, I want to have a cache for my repos controlled outside the repo code because I am running hard git resets and would lose the cache if i stored it in the repo I'm fixing.