Higher homotopy generalizations of Lie-Rinehart algebras, Gerstenhaber-, and Batalin-Vilkovisky algebras are explored. These are defined in terms of various antisymmetric bilinear operations satisfying weakened versions of the Jacobi identity, as well as in terms of operations involving more than two variables of the Lie triple systems kind. A basic tool is the Maurer-Cartan algebra-the algebra of alternating forms on a vector space so that Lie brackets correspond to square zero derivations of this algebra-and multialgebra generalizations thereof. The higher homotopies are phrased in terms of these multialgebras. Applications to foliations are discussed: objects which serve as replacements for the Lie algebra of vector fields on the "space of leaves" and for the algebra of multivector fields are developed, and the spectral sequence of a foliation is shown to arise as a special case of a more general spectral sequence including as well the Hodge-de Rham spectral sequence.