Add test for checking correct tag inheritance

Check that tags are correctly inherited on prefix modifications.

Part of #507
Set inherited_tags on update

inherited_tags wasn't properly set on modifications to a prefix. All
children of the old prefix and children of the new prefix would be
updated but the actual modified prefix would not get its inherited_tags
set from its new parent prefix.

Fixes #507.
Merge branch '507-fix-tag-inheritance'