Invariant types in model theory