Detect environment and load settings accordingly