optimize_design function

Generic optimizer that can be customized by user provided functions for generating shuffles and progressing towards the minimal score