index: add tests for the tree cache

These test that we invalidate at the right levels and that we remove the
tree cache when clearing the index.
tree-cache: remove the parent pointer

This wasn't used. We invalidate based on the full path, so we always go
down the tree, never up.