Added support for per-thread collection of events.

This implementation does not have separate event log for each type of
transaction, but one event log for all transaction executed by a thread.