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.
WIP: initial tests for v3 resource queries