subtest_for / foreach function to combine subtest with for loop

This is an untested proof of concept.  Wanted to RFC before I finished it up.