Add types for lifecycle events.

User-initiated stop is different than system-initiated stop, and there are unbounded reasons for each, for which the user might want to customize behavior. I think we should parameterize the stop operation with an arbitrary string `reason`, and pass this down to the PreStop hook. Ditto once we add a PostStop hook.