Move parent and root caches to a separate module cache.cc/.hh