Updated test script to be more flexible and to remember what tests have passed, which makes it easier to re-run tests when one fails.