Basic functions for repository synchronisation.

CouchDB db still has to be created first for security reasons.