Purpose:
Performs a deep copy of an object.
That means a new object is created and all fields are copied
into it. If a field itself contains an object this one
is recursively copied.
Return Values:
Returns an object which is the copy of the object.
Caution!
This function doesn't detect and
resolve cycles. Thus, the object passed to this function must have a tree-like structure.