Compound nodes in Boxes

This fixes a problem where Boxing Nodes which had other Nodes as children (for instance another Box) caused deeply nested Plugs to be incorrectly promoted. Yuta reported this behaviour with a standard material, and I think the unit test I added and fixed in this pull request simulates the problem he was seeing - could someone try at the other end?