add paginated query streaming to relate

Moved the StatementPreparer to its own file, added PaginatedQuery, and added
tests for the PaginatedQuery