Extensions of vertex algebras. Constructions and applications