Raise and catch a specific error during validation

This changes stack creation to return an error message instead of an
exception when (some) validation fails. It doesn't convert all validation
errors to keep the patch at a reasonable size.

Change-Id: I6364bccacbc1d447a99ea61565c96fcc90bd21f9
Partial-Bug: #1276623
Check top-level sections when parsing a template

This patch adds validation to template parsing to detect any sections
that do not comply with allowed sections in a template. In the past,
there have been cases where small typos in section names (e.g.
'output' instead of 'outputs') did not get detected and caused issues
at a later point, i.e. by simply not showing any stack outputs.

The place where the template.validate() call has been added to the
parser code only affects new stacks and rejects invalid templates
with an error message. This does not affect stacks that are already
in the database (I did some tests to check this).

Change-Id: Ifed4207badeb364675c905224ba762a9d8eaedd9
Closes-Bug: #1297761
Merge "Raise and catch a specific error during validation"
Merge "Check top-level sections when parsing a template"