Changed meaning of buttons in pager

The << and >> buttons in the pager now go to the first/last page.
Scroll to top after loading a new page in index
Write page changes to browser history

The pager writes history, so that the user can skip back and forth
between pages when browsing and gets back to the right page from a
problem he clicked.

We also cleaned up the class a bit and encapsulated most properties and
functions.