move Tests.am generation code out into testprog.am