Of Dice and Games: A Theory of Generalized Boosting