fix imports
refactor to initialize syncdb in just one place

this allows also to use in-menory sqlcipher databases
for tests.
avoid deferring if sync_target hasn't a syncdb
test for deferred sync using syncdb