ATS: cleanup and rebase

No functional changes. This is a rebase, rename, API consistency changes (virtual keyword and checks for NotNull), and one bug fix (fixing a test mock)