Add some debug functionality to client, add fuller functionality to server