added terminate_service function and unit tests

terminate_service just changes a bool flag so we can signal our main loop to stop.

Added unit test for drop_connection logging and main.