Move template_format from heat to heatclient

heatclient needs to (YAML) parse the template to allow it to populate
the content for get_files function calls. For this reason, template_format
(and environment_format) have been moved to heatclient so this code can be
shared by both heat and heatclient.

Change-Id: I3cc11cd57256ad539efb4dab314ac07547e9e6a2
Fetch environment from fields rather than function arg

This is part of a refactoring of the environment code in preperation for
supporting the get_file intrinsic function.

Change-Id: I8bfc0e17822bb2fa66665241e8873cf7cf1ea611
Merge "Move template_format from heat to heatclient"
Merge "Fetch environment from fields rather than function arg"