Added extension method to perform deep cloning.