Paged query support

This pull request adds paging support to all of the (relevant) query endpoints.