Added in_place option to merge_nodes

This is in relation to the discussion that happaned in #1100. After this is merged, I will make the appropriate changes in #1100 


always return `new`, not just when not `in_place`. (It makes it easier to deal with functions that always have a return value.)