implementation of cloneDeep

see #455 
Yeah, those damn local states...