Clean up test framework and simple rewrite to ensure all current tests pass