Generic Math.md: Refactor onto single type hierarchy. (#2462)