Add a caching key server client.

Also add a test program for the API.