Refactors pagination links

Refactors pagination links to use AJAX and include all search
parameters.