clean up Utils.toTxReport and TxReport.resolve

simpler Utils.toTxReport, no need for so much casting and conversion
treat tempids map as opaque and use Peer.resolveTempid in TxReport.resolve
remove code duplication in DDatabase.withData