replace IO::String with handles opened on refs
dancing around to deal with text i/o to strings

this needs tests, see github issue #4