Jko/record events

Event recording. Uses a model that's very similar to the Java SDK.
Actually, not if you want to guarantee that we're not exceeding the queue capacity. If we call flush() here, it'll have to be done asynchronously, so we'd still either have to drop this event or exceed the capacity in order to process it. For the moment I'll leave this as is for consistency with the other clients.