Remove some superflous logging.
Streamline logging.
Improved database access code for csync.

- Use precompiled database statements
- Store them in the csync context struct
- Hand whole context as parameter to db access functions
Fix quoting of query by text.
Add C++ extern "C"
Add new test to test the csync database code.