Single-molecule studies of nucleic acid folding