Improved JSON marshalling
Merge branch 'ledger-json'