use :default_env variable consistently in templates and codes
Merge pull request #564 from teohm/v3-default_env

Use :default_env variable consistently in templates and code.