T-duality, gerbes and loop spaces