Refactor and connect column sorting.
Pagination works again. With some logging even.