Separated Raven code from Raven MQTT code. Made reusable objects. Raven emits events.