Added LastDuplicateDate and support for sorting by last occurrence of an exception in addition to the first occurrence of an exception.

This makes diagnosing an exception that just occurred much easier.
merging jeffs branch