Main code calls networking code now
Added first test code and threads
Added thread support