Provide unique IDs for watches and timeouts (by presenting their C address as an integer) so that they can be stored in indexed structures such as sets and maps.
Use distinct types for watch and timeout IDs.
Add string_of_id conversions for opaque watch and timeout IDs.