Refactoring; moving MQTT to libraries.