Make plugin remove relationships correctly.

+ Fix detection of existing relationships.
+ Add code-level documentation.
+ Add `notify` config item.
+ Configuration of rules is still only temporary.