Improve pagination

- Eliminate PaginationHelper. Use the freemaker macro, instead
- Fix invalid sorting NULL