Tidy up TeamInvitation class and instantiate with a hash.