Fix bug where page size for offset calculation was fixed to 30.

This commit restores most things removed by the previous commit, as they are
needed to support use case such as:

    Model.page(x).per_page(y)

Such use case is why `per_page` has to call `limit` (even if it has been called
by `page`), and why `limit` has to then call `offset` (even if the `limit` call
itself is preceded by a call to `offset`). Flexible interface, convoluted
implementation.

Also make tests pass by changing the expected query spawned, since we always do
the count query now.