Move ball logic to server, and start modularizing server-side functionality.