addEventListener fallback for IE8

device.js doesn’t work in IE8 – and likely below – because it doesn’t know what addEventListener is. I added attachEvent and dumb function fallbacks if the browser doesn’t support addEventListener.