Adding default method when object does not posses the `toArray` method

If object does not posses the toArray() method (such as when you are using a basic composer project), we can have a fallback method to continue converting object to a multidimensional array.