Refactor TermIndex::getEntityIdsForLabel

Now the method returns an array of EntityId objects instead of
an array of arrays of the entity type and the numeric ID.

This also reduces the number of usages of the legacy numeric IDs.

Change-Id: I2d24b03b6bebc7763cf5452b2b7933d016e6cfef
Merge "Refactor TermIndex::getEntityIdsForLabel"