Implement deep merge for environment configuration

This updates the environment configuration merge to be a deep merge, rather than just a merge of the top level keys.