Client: fixing multiple protocol code, moving packet crafting to utils