Adjust tests for new add_database changes. Make sure that first db added to a new group is source, but if to an existing group, always target.