Added ability to provide custom eq/hash functions.