Improve migration optimizer to be able to optimize through other ops
First pass on squashmigrations command; files are right, execution not.