Problem: Client-server code is spread out. Solution: Move client-server code to a new file. (Yegappan Lakshmanan, closes #5885)