Catch and warn about template compilation errors

RT warns when saving a template which fails to compile (for example, due
to improperly closed braces).  However, if this warning is ignored (or
the template was imported by hand from initialdata), the only hint as to
this came at the debug level:

    [debug]: Skipping Scrip #7 because it didn't Prepare

Make the template compilation error explicit, and show which template
contains the error.
Account for new compilation warning
Merge branch '4.0/template-compile-error' into 4.0-trunk