Roles of oxygen and nitrogen in control of nonlinear resistive behaviors via filamentary and homogeneous switching in an oxynitride thin film memristor