Move keyAsObject to ObjectId and StringId since only of use there, so we
save space in primitive identities