Added ToArray and ToArrayRecursive interfaces, and ToArrayRecursiveTrait trait.