Flag squashing. Actual workings. More tests, and a dry-run option with nice logging.