add configuration for env and working dir

Hi @progrium,
thank you for this library.

I'm using it and had to add configurability for working dir and custom environment variables, maybe it's useful to you too.

Cheers, Enrico