Change GenericEntity to properly be converted to an array via iterator_to_array

This allows entities to be properly converted to arrays using iterator_to_array.

The iterator_to_array method is used in Twig, so this PR allows aura.marshal collections to be properly filled when passed into twig templates.