Implement next and last buttons

Not the prettiest conditional logic for handling the pagination event
inputs, but pretty straightforward.