Supporting graceful signal shutdown.

Adding a signal handler and gracefully shutting down all threads.
nit: Shall we stick to go's logging style guide and start the logs with small caps? I am saying this in light of other refactoring PRs that are making the same change.