Cleanup on deactivation

To avoid conflicting with my other pull requests, this branch was branched off of my enable_ie_support branch. Check the last commit for changes related to this pull request.
That's not my code. I just moved it into the anonymous function so that I would have access to the scribe configuration (scribe.targetWindow.document lower down in the function).