Backport master fixes to remove cdbsync dependencies to 13.1

See #41 and #45