Heteroatom facilitated preparation of electrodes for sodium ion batteries