Split out caching into separate class from SourceTree