Determining Microscopic Viscoelasticity in Flexible and Semiflexible Polymer Networks from Thermal Fluctuations