Generate CVS file from transaction history

Closes #1673