Functional carbon materials addressing dendrite problems in metal batteries: surface chemistry, multi-dimensional structure engineering, and defects