Deeply clones an object in JavaScript, safely avoids nested objects.