Fully working deduplication
Usage example and tests