Add the backup client and a bunch of tests.
Fix up a few spots while getting tests working.
Add state storage and resolve circular imports.