Properly deregister event handlers to avoid executing events on obsolete documents when editor is restarted.
Merge pull request #1 from devkat/master

Properly deregister event handlers to avoid executing events on obsolete...