Use "key" parameter for sort instead of "cmp"

The "cmp" parameter is not supported in Python 3 anymore.
Merge pull request #20 from jonasvp/patch-1

Use "key" parameter for sort instead of "cmp"