Initial work on events.
WIP.
Various updates.
Comments.
Events are ok.
Minor fixes.
Merge branch 'events' into next-release