simplify flow of paginations
Clarify else condition
Don't generate function if pagination is not enabled
Move variable declarations to the top
Test if $page_size has a meaningful value
Set default default number of items to 0 (ignore)
Merge pull request #15 from Recras/pagination-refactoring

Pagination refactoring