Higher-dimensional loop algebras, non-abelian extensions and p-branes