Refactor out GetNextSelection; add command replace_next

#454 
Yeah that is a good thought, I'll go ahead and make that change!