Clean up some comments

from previous commit for #248.
Merge tag handling with common trigger

Handling of inherited tags becomes easier now that everything can be
merged into one, slightly larger, trigger function.

It now also handles DELETEs which is a prerequisite to correctly handle
inherited tags. The trigger is also set for a few more actions, like
when tags are changed. This means that we might do more computations
more often.. not sure of performance impact.

Part of #248.