Improve performance of some RPC ledger commands using visitors.
Adds SHAMap::visitLeaves and Ledger::visitStateItems