Read the environment name directly from the Platform environment variables.

This patch stops parsing URLs and use's PHP's getenv() function to determine the environment name instead. It also updates the readme and related code docs.