Sparsification, online optimization, and an almost-linear time algorithm for maximum flow