Refactor conkeyref and export anchor processing