Higher-order Fourier Analysis and Applications