Event queue impl

These commits ensure graceful shutdown - We first shut down the http server and then wait for the existing events in the system to be written to the taps before shutting down the service.