Make script more readable
Ensure that all transaction output has the same number of columns
Remove unnecessary SQL
Code efficiency improvements
Merge pull request #529 from timschofield/develop

Make script more readable