reduce couch queries by prefetching relevant cases during restore
remove unused argument / bad practice of doing work in __init__
add db cache test and fix bugs that were revealed
delete unused function
Merge pull request #77 from dimagi/sync-optimizations

reduce couch queries by prefetching relevant cases during restore