Implement smart pagination in /mine.

The algorithm needs improvement but it's a decent enough start.

"Fixes" #221
Merge remote-tracking branch 'adys/master'
Touch up pagination fixes, closes #139