Chlorine gas cylinders in municipal water use are in the process of going the way of the dinosaurs because they are extremely hazardous.
They are being replaced by liquid chlorine generators either using calcium chloride tablets (water soluble solution ) sodium hypochlorite ( rock salt and electricity). The resulting chlorine product is so weak that it won’t even bleach your clothes.
Ammonia can be very deadly too. I remember this event as if it were yesterday. (and now there are 18 wheeler wrecks daily in Houston) any thing can be a bomb, any chemical can be WMD....
http://www3.gendisasters.com/texas/18813/houston-tx-ammonia-truck-explosion-may-1976
Yep, I am acquainted with the on site generators you described and they are a viable option for smaller scale systems. At a point though, the on site generation becomes prohibitively expensive though so ton chlorine cylinders will remain common for larger systems.
Bull!