Unified Methods for Exploiting Piecewise Linear Structure in Convex Optimization