Flat collections updates

Move flat map and set to FlatCollections.
Update the flat collections so they don't barf if two elements have the same hash code.
Types utility class now uses FlatCollections