Move creation of custom env to environment module

This patch replaces the _nested_environment with a new method in the
environment module.  The intent is to make it easy for some resources
(such as remote-stack) to use its own environment without having to
subclass from StackResource.

Change-Id: Ice0124aa21086788e957eb708b6bc423779202bc
Merge "Move creation of custom env to environment module"