Stepwise ammonium enrichment using selective battery electrodes