refactor env escaping

add unit tests
don't escape twice
don't shellescape shell variables
fix quotes
fix tests
Merge pull request #232 from heroku/schneems/fix-env-escape

refactor env escaping