Added shutdown handler for daemon. Handles Ctrl-C.
Changed the shutdown handler to use a callback rather that listener-specific behavior.
Added shutdown handler for host as well.