More refactoring and getting port handling started.
Support for file streams.