removed unused imports
fixed nonworking circular import
testing some more refactoring
protocol made into a class derived from threading.Thread