Use |= instead of = for deletions.

While we don't care about any other changes in case of deletion, we
already check if the deleted flag is set. So we don't need to throw away
other flags. And like this it's better to test.
Test compount id generation and simplification