Thermal and electrical energy storage