Further improvements to javascript smooth scrolling