Changed how the number of pagination pages are calculated, added
functionality to add a current class to selected page.