refactor MQTT client, keepalive supported

QoS 1 to be supported