Threading and connection now works. The UI displays the connection state
as well!