Now using copying in stead of layer merge. Allows for selections to be limiting to operation, and no more problems with layer references becoming invalid. note: does not return the layer object any more (actually, thanks to a bug, neither did the original one :))