added cmp_to_key support for python versions lower than 2.7. Fixes #12