Let $C$ be a nodal curve, and let $E$ be a union of semistable subcurves of $C$. We consider the problem of contracting the connected components of $E$ to singularities in a way that preserves the genus of $C$ and makes sense in families, so that this contraction may induce maps between moduli spaces of curves. In order to do this, we introduce the notion of mesa curve, a nodal curve $C$ with a logarithmic structure and a piecewise linear function $overline{lambda}$ on the tropicalization of $C$. This piecewise linear function determines a subcurve $E$. We then construct a contraction of $E$ inside of $C$ for families of mesa curves. Resulting singularities include the elliptic Gorenstein singularities.