Improve tests for EntityView.

Minor refactoring to improve testability.
This is ground work for tracking more types of links.

Change-Id: I00f7e2a9cfe02024642bdaf2d99b8d57e5b2e9df
Merge "Improve tests for EntityView."