Move protocol and messages into their own files