Refactor EntityContentTest and related

I'm aware this clashes with parts of one of Daniels patches that
touch the same tests. Maybe it's better to merge Daniels patches
first. I will rebase this later.

Change-Id: Ibe19dc0c8930c22afc4eb9334fb2e479d49d5f1b
Test that non-legacy JSON is not recoded

This would be expensive and should be avoided, obviously.

Change-Id: I45a937775f263bb8b5701f404d276a7d5bc8b80c
Merge "Refactor EntityContentTest and related"
Merge "Test that non-legacy JSON is not recoded"