Adding full support for optimistic concurrency in the update pipeline

This was read-only before so that EntityType could keep its indexes in sync. If it is mutable, then EntityType needs some other mechanism to make sure indexes stay in sync.