Log Message: 
Added historicallyrelated set/bag/map optimization.
This optimization applies to `union', `intersection', `setdifference',
`setdifference2', `bagdifference', and `mapmerge'; and `compare' on
sets, bags, and maps. (Of these, the difference operations are probably the
ones on which it is most useful.) It very cheaply detects cases where the
two operands share some of their subtrees, and takes the appropriate
shortcut. (For example, the setdifference of a subtree and itself is the
empty set.) The two operands are likely to share some subtrees if they are
historically related; e.g., if one is the result of performing a small
number of `with' and/or `less' operations on the other, or if both of them
are related in this way to a third collection. In such cases, these
algorithms can now run in log time rather than linear time, making this a
potentially quite significant optimization.
