Rewrite footnote smooth-scrolling code

Now preserves the hash in the URL and uses a colour from the colour
scheme. Code is slightly cleaner too, though realistically the two
functions can be abstracted into one. For another day, when I don't
have to commit something in the next 9 minutes in order to keep up my
streak.