Use operator.itemgetter() instead of relying on functools.cmp_to_key().

This approach is more direct, faster, and extends backwards compatibility
from Python 2.7 to 2.6.