Add name_show command and fix RPC client.

Add the name_show command to the server, and improve the JSON-RPC client
mode by showing more detailed error messages and better error handling
in general.