Added networking support, split most of the tasks as they should be in a client-server game