Algebras, BPS states, and strings