An Analytic Model for Mass Transfer in Binaries with Arbitrary Eccentricity, with Applications to Triple-star Systems