Vastly simplify reordering algorithm

It turns out that, if one thinks for a few moments about how the import
event list must actually look, there is no reason for the reordering
algorithm to be a full depth-first search.  A simple loop is enough!