refactoring sunos code
use stdio streams, not unix fds
refactor string handling