Added mqtt support
Corrected bugs, added configuration options