Inversion of torsional oscillations for the structure and dynamics of Earth's core