Added enforcement for new federated invite checks and corrected a bunch of related spec compliance issues along the way. Contributed by @nex.