Fixed heartbet issues. Now using IO::Select with timeout so _heartbeat
file can be touched regularly

Installed signal handler for SIGCHLD.