OO-2429: move the foreign key from identity to user, remove double mapping of identity, add more unit tests for invitation, unify the methods to create the user and identity