Structure and function of spontaneous network activity during circuit formation