Re-resolve functions during stack update

Functions in new resources must be resolved again to refer to the new stack
in which they are to be inserted.

Change-Id: I0f986d3042fb70aa0bb7b8f0e2c514baa212ba1f
Calculate dependencies based on unresolved template

We previously calculated dependencies based on the template snippet for the
resource after static functions had been resolved. The distinction between
static and runtime resolution of data is going away soon, which causes
problems with that. Rather than rewriting the dependency code now, just
calculate the dependencies from the unresolved template instead. A future
patch will replace this code by allowing the functions themselves to
calculate their dependencies.

Change-Id: I2d193025219ce78b811090fc4eb459a89bd2fa26
Merge "Re-resolve functions during stack update"
Merge "Calculate dependencies based on unresolved template"