Refactor and document Tuple.
Add ConcurrentHashSet; refactor SetMemoryRelation to use it.