move paginate to lib

- grammar in tests