Instead of tracking prefs, simply remove as fallback.

Additionally, clean-up the code. Do not process non-existing documents.
Only process refresh and saved events if the document is current.