I think the answer is cogeneration. No gases should be burned for any process or heating without turning a turbine to generate electricity. All gas appliances (except maybe cooking) should have a mini turbine within them or the mechanical systems of homes altogether nead to be more integrated and/or thought through.

Could you imagine how much electrical energy could be created using even 10% of the natural gas we burn just in residential water heaters?

Then the grid becomes your battery. excess energy gets deposited to be withdrawn when needed.