Pull IO stuff out to a separate module.