Issue #2028499 by tsphethean, damiankloip, dawehner: Drupal_sort_weight() should be converted to a class.