Neutron Scattering Studies of Cuprates and Iron Pnictides