Backport Enumerable#max_by for 1.8.2