Fix sliding direction and show correct nav links

Pages now slide to the left or to the right depending on which page
we're going to. Works also for browser back/forward navigation.
When going to a new page, nav links are updated accordingly.