Charge storage and transport in metal oxide resistive switching devices