Bring TestTransaction closer to being a unit test.
Drop sys.argv and sys import.