Refactor out GetNextSelection; add command replace_next

#454 
Why `*[]replaceTest` isn't `[]replaceTest` enough?