Remove flicker in smooth scrolling

I noticed a little flicker when clicking between sections of the documentation. This came from the browser making the immediate jump to the fragment identifier before the `scrollTop` animation had a chance to get started. The changes made to get around the jump:

- If the click meets the condition for smooth scrolling, prevent the default scroll and hashchange.
- Once the smooth scroll is completed, update the `location.hash` to the new fragment.
- Doing the above two messes up the back button functionality a bit (out of step by one history entry), so a `hashchange` event listener is in there to make the right jumps on forward/back.

Thanks as always for the great library.