Cleaned Up Threading

Removed global variables in favor of a server acknowledged disconnect.