Quantum (String) Statistics and Spacetime Surgery: Generalized Verlinde formulas