Added ClientListener, managed connection fail, added buttons for settings and reconnection, minfixes