APP_ENV changed to KOMET_ENVIRONMENT, better env detection