Change file I/O API for string to prepare for Phobos integration