Performance: cache parsed `keyContents`, do as little as possible in `tryAddRelated`. Ref #231