Clean up events implementation, add some samples.