Factor hard constraints out of EntityContent

This removes some nasty dependencies on global state
from EntityContent.

Change-Id: I439ca5d678bcf80d634b9d9401f7aca9618ae365
Merge "Factor hard constraints out of EntityContent"