Split server and client code into their own files