Cleanups and documentation for the first half of single_test.py.

Also fix some failures with 2.0 (there's always something).