Fix event attribute access outside of callbacks

Internet Explorer restricts access to the event object so that it can only be used in a callback. Once passed through to a timeout or referenced inside an inner closure the reference becomes invalid and no properties can be accessed. Copying all event data into a plain object and passing that instead resolves the problem.