bugfix in tests - more cleanup
factor snap-testing module out with general code