Cleaned up a little.
Switched from messages to events for notifications.
Updated example with event callbacks.