Add pagination.

Implements #10.