MDS reordering: matches and better remote rebuild
MDS reordering: matches and better remote rebuild

The mds_reorder call was not preserving matches.
Also, the algorithm being used for remotes was
strange. Replace it with the more general
algorithm from apf::convert, use it for both nets.

This is a serious core change, rerun all tests.

yangf4/core,yangf4/core,yangf4/core,YetAnotherMinion/core,YetAnotherMinion/core,YetAnotherMinion/core,YetAnotherMinion/core,yangf4/core,YetAnotherMinion/core,yangf4/core