A Spectral Approach to Optimal Control of the Fokker-Planck Equation