Move the next-submission logic into the model

Clear up the view a bit by moving the logic for selecting the next
submission into the model. This makes it easier to add more logic to
this later.