Diverse Protein-Folding Pathways and Functions of β-Hairpins and β-Sheets