Refactor test resource data generation into utils namespace

This commit simply moves a bunch of hard-coded logic for generating
test data for resources out of the test namespace and into a
utility namespace, where it can be used for additional tests.
Add support for paging on resources query endpoint