change dupe ranges to be sorted on target rather than query.  also add merging of contiguous dupe ranges sets.