Adding some more tests and centralizing some testing logic.