Enhancements to TraceEngine

* Record transaction counter as first field of output.
* Capture transaction begin/completion too.