Add typespecs and to_string conversion to some IO APIs
Document side-effects on stream APIs