Multifunctional behaviour of graphite in lithium–sulfur batteries