Fix Bug 897286 - Add Better Pagination for all pages. Refactor controlling code into UI module