Cleanup of the port program

- Fixed issue with a lag of stdin keypresses in the shell in some
  processes
- Added {stdout, print} and {stderr, print} process options for
  stdout/err printing (mainly for debugging)
- Major cleanup of port program code
- Fixed {stderr, stdout} redirect

Known issue {stdout, stderr} redirect doesn't work properly