Add types for lifecycle events.

Switched to handler.  Would prefer to defer the merging to a different PR.