Simplify test framework and fix tests for Python 3