Added heartbeat and cleaned up pubsub start/stop