utils; Re-work pagination

Rather than passing several variables around to various functions,
create a structure to contain them and just pass that.

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>
utils: Simplify 'from' calculation in get_page_pagination()

Previously we were doing

    pn->from = pn->page_no * pn->rows_per_page - pn->rows_per_page;

this is the same as

    pn->from = (pn->page_no - 1) * pn->rows_per_page;

i.e

    a = x * y - y

is the same as

    a = (x - 1) * y

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>