Add __iter__ method in Collection class
Add type guards in lookup, fix tests, and refactor