Single-molecule studies using magnetic traps