2.3 allow nested forms in entities

Commits present in 2.4.x branch that also apply to 2.3.