make TermKey and IdentityKey comparable