Refactor to classes

This introduces the TestCollection, Test and Case classes. I've spliced them into the current framework so that all current tests pass against the changes.