Added many more tests for the main code.