Add information about pages and items in the current page

The `pagination` object stored in the metadata now contains more
information:
- total number of pages
- index of the first item in the page
- index of the last item in the page
- number or items per page

The `pagination` object have changed and now contains two sub-object:

    page: {
        current // current page number
        total // total number of pages
        next // next page number
        previous // previous page number
    }
    items: {
        total // total number of items (for all pages)
        per_page // number of items per page (or undefined if it cannot be computed)
        first // index of the first item in the current page
        last // index of the last item in the current page
    }

This is needed to ease the use of the `pagination` object in templates, as Handlebars do not allow arithmetic in templates.