Effects of functional groups and anion size on the charging mechanisms in layered electrode materials