Extract render_template() function
This beefed up version of flask.render_template() reduces some duplicate
code, collecting the addition of data from the job manager and the
preservation of form inputs in a central location. This also introduces
a central place where variables needed by the base.html template can be
added.