Supporting graceful signal shutdown.

Adding a signal handler and gracefully shutting down all threads.
I would prefer choosing one style for all logs. Less cognitive burden and consistency.