Move environment merge to top of framework defaults, call setupEnvironment() separately in same place as before. This should fix basic environment-specific configuration and still allow for complex, conditional overrides later.