Class for doing the generic routines of deduplication. This has various routines for deduplicating elements.