Emergence of classical time from a universal wavefunction