rename pipe_to_string() to capture_exec() and improve it's interface