Code simplification.
Allow array to be passed to App::environment().
Add tests for App::environment().
Merge pull request #6348 from vlakoff/app-environment

[5.0] Handle Arrays In App::environment() And Add Tests