Massive perforance improvements for very large mappings

The current implementation of SortedCollection (with TopologicalSorter) is very expensive when dealing with larger sets (>1000 entries). This is mainly caused by the fact that SortedCollection re-sorts the entire collection for every element added, including determining the ordering relations. This implementation keeps track of ordering relations for all elements while they are being added and only sorts when needed. In our project, this reduced the processing time by a factor 10.