This is an alternative implementation of #37 .
It doesn't need additional configuration, but enables range retrieval automatic.
It also add some testing.
Fixes#32
Run sync within a SQL transaction, so that no partial sync happens
Don't abort on SQL errors, but print ERROR notice
Exit with code 1 when any ERRORs were logged
Silence the test suite, so that test runs are more clearly
Use PG queries instead of psql in test. This is more flexible
than parsing text outputs per Regexp.