Generally working runtests.py; many tests still need fixing.