Measure sorting

Measure sorting used to be done in blocks when the sort method was called on an array of measures. This moves it into lib/ext/measure.rb, so we have a central location for sort logic. All of the old sorts were supposed to be by nqf ID, according to the commit history for the sorts, but one of them was not; this will clean that up.