Automatic depaging of queries

Includes tests of the de-paging feature.