The CLI client works
Fixed a lot of thread closing issues