Implement pagination

Closes #13