These changes make the internal state (TDI_t) the reference for domain
ids, which are generated on the fly as domains are added.
Routines iterating over domains make sure to keep this state updated, so
that, at any time, any domain in existence has an entry in the state and
thus an immutable (once discovered) id.
While there, implement getDomainInfo() as a wrapper over
getAllDomains(), returning only the domain we are looking for.