Rewrite algorithm to match latest spec; fix various bugs; instrument runtime for tracing
Fix serious bug in OrderedSet:hasIntersection()
Add some comments