Eliminate some extra indirection in sequence.toArray()
Add tests for sequence.toArray()