insertEffects: fixed caseOf

We needed to insert the binding after the children are handled. For
this, I modified mapIn1RebuildTree to take an optional extra action
to be carried out after the last child.