moved from my own hacky child_process implementation to @jsantell's