Improve performance by moving to NSMutableOrderedSet
Attempt to fix unreproducible crasher by replacing NSMapTable with our own weak reference collection.