Basic functionality to the point where Tcl_Channel types need to be implemented