Support ?offset=N in Case API

This is a blocker for commcare-export to be able to feasibly iterate over all cases.

These changes use as much of the exact same code path as the current API so as not to rock the boat.