Change scrollHistory to use window.location.replace

If a user visited a page with scrollHistory on, and scrolled down
the page, in order to get back to the previous page, they would have
had to click back in their browser many, many times.

This commit fixes that, so that as the user scrolls, the hash is
added to the URL, so the user can easily copy a link to the current
page, but it uses location.replace, so that the user doesn't have to
continuously press "back" to get to the previous page, which could
be unintuitive for some users.

If a user clicks on somewhere in the TOC, and then presses back,
they should still be directed back to the other part of the page
they came from. This commit should not affect that.