Made protocol an instance. Action an interface. Multithreaded server. Some other refactors