Rewrote run_tests.py in Python.