First train working re-factor of CmdlineParser, fixes to InputStream/OutputStream