Move environment and template file functions to own module

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

Change-Id: If6974fc72c47e6a5c6545e65375e75cfd177fb7a
Test coverage of empty environment

Change-Id: Iade321762a0e68605006252204d0dd4c7aac8a39
Improve and unit-test template contents fetching

This includes some important changes in the way template
content is fetched:
* for template_file, the value is converted to a file:// URL and the
  actual fetching is performed with the URL fetching code path.
  As a consequence it is now possible to specify a file path *or*
  a URL for the --template-file command option. This is a change in
  behaviour, and it does make --template-url somewhat redundant.
  This makes the behaviour of --template-file consistent with the
  behaviour of --environment-file.
* for template_url, the content is fetched in heatclient so that
  the server does not need to fetch the template at all. This means
  that in the API request the 'template' field is populated instead
  of 'template_url'. We can consider deprecating 'template_url' from
  the REST API.

Change-Id: Id8de05973381dba7ac052c45dd074071fd3035b2
Merge "Move environment and template file functions to own module"
Merge "Test coverage of empty environment"
Merge "Improve and unit-test template contents fetching"