Moved the TestResults class to its own file and refactoredsome code