Clearer document events handlers binding

In the handler, this trick was used to figure out which editor instance this is.