pull signal and tcp out to their own modules
unregistered file descriptors on close; fix stop handling