Move helper routines for JsonObject.
Make RPC::Ledger generic.