The unification of filament and interfacial resistive switching mechanisms for titanium dioxide based memory devices