Fix failing tests.

Previous tests could mess up later ones if they
weren't properly cleaned up. Added a sanity check
on teardown to make sure the tests have cleaned
up after themselves.

Split out some test cases into their own test methods.