Transforming oil wells into batteries for the sun and wind