Digitalized MLD and ZLD: Optimizing Through Modularization of Membrane and Thermal Systems