Jko/record events

It's not exported in the module-- it's just here for convenience. The lines below it:

```
if (require.main === module) {
    main();
}
```

determine whether this is running a script or as a module. In the former case, it calls `main()` as you'd expect. As we make the client drivers more interesting, I'll probably rip this out anyway. But while this is under heavy development I figured it's nice to have.