Computing energy levels by inversion of imaginary-time cross-correlation functions