(bug 57231) Use ResultBuilder for EntityData.

This changes the EntityData facility to make use of the ResultBuilder
class for constructing API results. This ensures that the generated
output is the same as returned by the API.

Incidentally, this also causes each snak's data type to be included
in the output.

Change-Id: Ib7391bebf5bf62f947b81ac5cf233467862196be