Update documentElement className when changing page

Not sure if there is a need for this outside of my circumstances, but a theme I'm using makes use of html classes for styling, so I need that to be updated on page changes otherwise the styling gets wonky.