Sulfonium compounds and other onium compounds as potential components in coatings