Allow attributesToArray handle instances of ArrayableInterface

Ran into a stackoverflow question where the problem was that attributesToArray wasn't able to handle instances of ArrayableInterface properly. So added handling for that in the model