Replace imperative code by higher-order functional code in `EgalitarianDP'.
Merging the changes Marshall has made to 'EgalitarianDP', in a similar fashion to 'Egalitarian' and 'EgalitarianBrute'.
Merging the changes Marshall has made to 'EgalitarianDP', in a similar fashion to 'Egalitarian' and 'EgalitarianBrute'.