Move some functions around in clients.c and expose client_afrom_cs so it can be used to parse dynamically generated client sections