test framework and fixes to results processing. some was VERY wrong