Add a defaultQueryPagination function, fixes #2