Make logging configurable
Close out pipe when reading 0 bytes
Log dying stats to stderr
Protocol impl cleanup