Unified Sample-Optimal Property Estimation in Near-Linear Time