Replace qsort.cpp with std::sort.
Skip duplicate IDs on merge.