Implement smart pagination in /mine.

The algorithm needs improvement but it's a decent enough start.

"Fixes" #221