Add paginate options.

Signed-off-by: crynobone <crynobone@gmail.com>
Small tweak and add more testcases.

Signed-off-by: crynobone <crynobone@gmail.com>