Improvements to EntityContentFactory and its tests

Change-Id: I563d902b3d6a5c9b84b4a43652dc8d0f90c7d57b
Merge "Improvements to EntityContentFactory and its tests"