Clean up tests.

These commits simply make the tests way more readable and easy to
follow.  They should also make future tests easier to read and write
because they create new common functions that will occur frequently
throughout the rest of the upcoming tests.
Clean up, clean up, everybody do your share... merge (sure hope this doesn't break anything...)