more C++11 conversion.
replace feed_cmp with something simpler.
make std::sort and std::stable_sort simpler.