Returns a deep copy of an object with all functions converted to spies.