Fix for RT-1826

Added a getAmountReceived() in JsonRewriter. It uses the DeliveredAmount field
if available, otherwise calculates the value from metadata. For normal payments
it just returns tx.Amount.