client: Add optional callback to `emit`

Closes #4.
test: Add a simple example/test extension

Closes #2.