ShellTool: added a way to handle each line of stdout and stderr with closures