Changes in ToArray implementation

- simplified ToArray implicits
- some changes in its definition
- more tests