Implement basic MQTT broker functionality

Only connect, publish and subscribe.