implementation of cloneDeep

see #455 
Left over from an older attempt. Changed.