Copy an object deeply