From http://stackoverflow.com/questions/613183/python-sort-a-dictionary-by-value
Sort a dict by value