major test.scm refactoring