Dispersant and compatibilizer for pigment dispersions, waterborne and solventborne coatings