Refactoring server code

move methods from SessionServer into WriterServer
move methods from Process into SessionServer
Refactoring client code