Client thread now works, numerous tweaks.