Pagination

Quick and dirty hack version.

Needs tests and must be refactored along with the
coming persistence changes.
This file isn't used here. I think it's a hangover from where the WIP branch was started from