Fixed up the clients/connections vector debugging functions to be useable from everywhere and put in place a couple of tests. Still lots to do.