ENH: Some more tuning of the prev/next button behavior

Make sure that when selecting modules in any order then clicking Previous/Next traverses them in that order.
Without this fix it was not possible to change the order of modules that were already in the Next list.