Added generic collection class and wrote more tests.