Add support for custom paginated responses in API resources.

WebAPIResource now allows subclasses to set `paginated_cls` to a
subclass of a WebAPIResponsePaginated. This will be used for handling
the pagination of the resource's queryset and for serializing the data.

WebAPIResponsePaginated has been fully restructured to make its behavior
customizable. Subclasses can override nearly every aspect of it,
including previous/next calculation, URL building, results fetching,
link building, etc. This makes it possible to do such things as paginate
by SHA1, or by page (instead of result item index), or fetch data from
something other than a database-backed queryset.

Reviewed at https://reviews.reviewboard.org/r/5895/