Make toArray support objects with public properties

This makes it so that toArray() will support objects with public properties that are defined in the class, instead of dynamic properties.