Move client debugging code to its own file.