Capacitive deionization of divalent cations for water softening using functionalized carbon electrodes