[evaluation] Homogenize segmentation/classification code; Use more credible constructs (DRY); Fix test units