Fleshes out logic for reading from stdout, stderr, and stdin