refactor to use environment hash and prepare for open3
use open3 for ruby >1.8
v0.11.0