Functional Classification of Divergent Protein Sequences and Molecular Evolution of Multi-Domain Proteins