Add a base class for pluggable functions

These functions can be substituted for their corresponding syntax in the
parse tree and lazily evaluated at the time their output is needed. Thus,
no distinction between statically-resolvable and runtime-resolvable
functions is required.

Change-Id: I3e89b6ee0d17b6755b35ab52b52a22a8d3db6c29
Refactor re-resolving of templates

In various places we are forced for various reasons to re-parse a resource
template snippet. Consolidate these into a single method call.

Change-Id: I087e4626082913617b962ba05c24d60537788504
Merge "Add a base class for pluggable functions"
Merge "Refactor re-resolving of templates"