Generic async RPC implementation, including JSON-RPC
