Wreath products of algebras: Generalizing the Krohn-Rhodes theorem to arbitrary algebras