Refactor getenv access using constructor

Another alternative to PR #6 and #7 including the idea of @bobthecow. 
`$this->env` is never declared, so it's a public member variable.