working! can send history to string or to file; uses StringIO to make the string usable.