Implement ToJson for &[T], and add tests. Closes #14619

Let me know if the amount of tests is enough or too much.