Microscopic Modeling of HfOₓ RRAM Operations: From Forming to Switching