Logging, and async machinery

Logging — Logging functions
Sequential state machine — State machine helpers
Timeouts — Timeout handling helpers