Refactoring

Cleaned up the Setup / Teardown code a bit, getting the functions down to a better size.  There's probably more that can be done along these lines, but it looks a lot better now than it did in the last commit.