Corrected structure for server/client model. Added packet handlers.