Rewrite plugin using ExtensionUtils and new PreferencesManager API