Supporting graceful signal shutdown.

Adding a signal handler and gracefully shutting down all threads.
Interrupt is SIGINT, SIGTERM we'll have to add the syscall.SIGTERM. Not sure if that works. Will try and send a PR if anything.