The amino and carboxyl termini of proteins as a lead for functional classification