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 


I would refactor these lines so that `if in_place: new = dst; else: new = self.max_node + 1` (`max_node` could be something that we maintain.) Then you can combine a lot of the lines below, and you just need one more if statement, `if not in_place: self.remove_node(dst)`.