Update .sort to use key for Python 3.x.

Rather than really dubious cmp function.
Merge pull request #34 from tekacs/master

Update .sort to use key for Python 3.x.