transactions:
- Add transaction counter and instance number for debugging purposes
- Minor code optimization
- toJSON(): add number
- update tests