Changes to entity and add tests.

As either doesn't return a map we can merge with and we need to be able
to have 2 types of identifiers.
Merge pull request #12 from MastodonC/feature/entity-changes

Changes to entity.