refactor to initualize syncdb in just one place

this allows also to use in-menory sqlcipher databases
for tests.