Jko/record events

Event recording. Uses a model that's very similar to the Java SDK.