SUGAR: An improved empirical model of Type Ia supernovae based on spectral features