(bug 58342) Inject TermBox when viewing

This introduces a generic mechanism for managing and expanding
placeholders in cached content, to allow user specific content
to be injected on demand.

This change also factors several bits of logic out of EntityView
and provides more fine grained tests.

Change-Id: I75cbbf01c644232f906a1d4f8e990b3fdbf781ec