Refactor AutoSave and tests.
Add AutorSave trigger test.