Change clogs wrapper to use a per-queue cache.

This is written in a generic way that could easily be moved into the
make vex codebase should there be any other uses for a per-queue cache.

Erasing is by context and this currently takes O(N) time instead of O(log
N). Given the rarity of this operation it does not seem worth doing
anything about.