Some initial work on the cache.

The idea is to cache intersections in the background and to keep
them up to date as the underlying indexes changes.