Move suspend-client code into detach-client.
Tidy up some includes.
Move template defines back into .c files.
Better format for printf format attributes.