Made comparator serializable so that caching works.
Merge pull request #1290 from ORCID/makeComparatorSerializable

Made comparator serializable so that caching works.