Localization on three-manifolds