This paper presents a new co-optimization formulation for energy storage for performing energy arbitrage and power factor correction (PFC) in the time scale of minutes to hours, along with peak demand shaving in the time scale of a month. While the optimization problem is non-convex, we present an efficient penalty based convex relaxation to solve it. Furthermore, we provide a mechanism to increase the storage operational life by tuning the cycles of operation using a friction coefficient. To demonstrate the effectiveness of energy storage performing multiple tasks simultaneously, we present a case study with real data for a time scale of several months. We are able to show that energy storage can realistically correct power factor without significant change in either arbitrage gains or peak demand charges. We demonstrate a real-time Model Predictive Control (MPC) based implementation of the proposed formulation with AutoRegressive forecasting of net-load and electricity price. Numerical results indicate that arbitrage gains and peak demand shaving are more sensitive to parameter uncertainty for faster ramping battery compared to slower ramping batteries. However, PFC gains are insensitive to forecast inaccuracies.