Generalized and Scalable Optimal Sparse Decision Trees