Spontaneous Creation of Macroscopic Flow and Metachronal Waves in an Array of Cilia