Issue #1309: fix adding/removing event handlers in IE8

Small fix for IE8 compatibility regarding event handlers.

P.S. I tried using the contrib flow, but it doesn't appear to finish the flow properly (after providing username, password, title and description, it just returns undefined. It might be because I have some 'funny' characters in my password, but I'm not sure).