fix using JSON in env_local

`$environment` was being set after the `array_merge()`, so local changes were blasted.
Merge pull request #23 from monking/master

fix using JSON in env_local