Add initial version of pagination. Not used by median calc yet.