This patch series cleans up and refactors run-tests.py so that I can understand what it's doing without getting a headache. Changeset comments are, hopefully, self-explanatory!