WithTopic returns a context with a new topic set, such that events emitted
from the resulting context will be marked with the topic.
A topic groups events by the target module they operate on. This is
primarily designed to support multi-module log compaction of events. In
typical journaling systems, the entries operate on a single data structure.
When compacting the journal, we can replace all former log entries with a
summary data structure that will result in the same state.
By providing a compaction mechanism by topic, we can prune down to a data
structure oriented towards a single topic, leaving unrelated messages alone.
WithTx returns a new context with an event transaction, such that events
posted to the underlying context will be committed to the event log as a
group, organized by a transaction id, when commit is called.