Listen to window scroll in a scalable way

Directly writing to window.onscroll will break any other code run before this that writes to that location and will be broken by any other code that runs after this that writes to that location. Replacing with addEventListener (shimmed for IE8) so that N listeners can be on window.onscroll