First-principles Calculations of Optical Energy Loss Functions for 30 Compound and 5 Elemental Semiconductors