Resistive switching in electrochemical metallization memory cells