Remove dependency on (Python 2.7+) cmp_to_key

Issue #34