Add toArrayDeep with tests