Refactored $chan->read's to work within while loops.  Also disabled PTY to solve issue with stdout/stderr splitting with callbacks.
Added comments and removed debugging module.