Subclass io.TextIOWrapper to fix write problems

Also, rename nullfile to iohelper and add basic daemon modules.