Algebro-geometric aspects of the Bethe equations