Cache CQ indexes

The coupling between `ddoc_cache` and `mango` is inelegant here but I erred on the side of keeping the patch set small.

BugzID: 4270