Commute ifs and miniboxing

Closes #23.