Make error message for InvalidTemplateReference sane

Previously it was more or less incomprehensible. Now it will report the
non-existent resource the uesr tried to reference and the path (starting
with Resources) in the JSON document where the error occurred.

Change-Id: Id98eb4157df16674b8c8a9a190b82ee350c5386f
Merge "Make error message for InvalidTemplateReference sane"