Use the new Schema class for template generation

Fixes bug 1265209

Change-Id: I66255246e273dba414d9230b6e92bb86390dc8af
Merge "Use the new Schema class for template generation"