Order-Optimal Estimation of Functionals of Discrete Distributions