Add support for IE8

IE8 doesn't support `window.addEventListener`, so we use the functional
equivalent instead.