Added Config struct to simplify configration. Simplified Loginand Reconnect.