Add types for lifecycle events.

Update comments, too.