If attributes array exist, use slice to create new object

Otherwise we may be sharing the same array between class and its
superclass.
If relationships array exist, use slice to create new object

Otherwise we may be sharing the same array between class and its
superclass.