Add utility for determining the fields used by a template