Molecular optimization of castor oil maleate as demulsifier for water-in-crude oil emulsions