rewrote everything to AVOID iostreams

compile is now ten seconds faster, and executable is 20kb smaller