Canonicalize sets and dicts before hashing