Prevent deletion of Commerce Types with existing content

This is a redo of the other pull requests.

- Small cleanups
- Dont allow removing entity types while they are still referenced