WIP
Document pagination

Quick and dirty hack version.

Needs tests and must be refactored along with the
coming persistence changes.