Added better error handling for MQTT connection and refactored generator to use one thread for all communications instead of 1 thread per vehicle