Improve prefix insertion time

Profiling (see #589) showed that calc_tags ate up a lot of CPU time and
this changes when we invoke calc_tags, essentially removing one case
which should be completely useless. When a new prefix is inserted, it
would invoke calc_tags on the parent prefix to set the inherited_tags on
the new prefix, but the before-trigger has already set the
inherited_tags of the new prefix, so it's a useless operation that not
only touches the new prefix but also all other prefixes within the same
parent prefix. Same features as before, only higher performance.

There are further improvements that can be done and I've added TODO
entries for some of them.

Fixes #589.