toArray method for tuples and arrays

Adds a `toArray` method to tuples and arrays to ease
polymorphism:

* for tuples, returns a copy of the underlying data
* for arrays, returns the array itself