No need to duplicate the algorithm.
Implement first simple version of query capacity.

Enough for now to force usage of querystorage and simplify allDocs everywhere else.