Twenty years ago, E.R. Fernholz introduced the notion of "functional generation" to construct a variety of portfolios solely in terms of the individual companies' market weights. I. Karatzas and J. Ruf recently developed another approach to the functional construction of portfolios which leads to very simple conditions for strong relative arbitrage with respect to the market. Here, both of these notions are generalized in a pathwise, probability-free setting; portfolio-generating functions, possibly less smooth than twice differentiable, involve the current market weights as well as additional bounded-variation functionals of past and present market weights. This leads to a wider class of functionally generated portfolios than was heretofore possible to analyze, to novel methods for dealing with the "size" and "momentum" effects, and to improved conditions for outperforming the market portfolio over suitable time horizons.