Messaging server refactored and tidy. All major functionality seemingly working. Need to refactor client parts. No tests yet