Maximizing the Grid Benefits of Behind-the-Meter Energy Storage