moved test instance generation into separate module

this is just the first step; it doesn't fix the awkward complexities yet