Move IO specific stuff into separate files.