Refactored replication document update system
Added debug messages for changes to replication docs
Bugfix: Quit GTK main loop properly if we catch SystemExit
Tear down peer list and replication relationships on exit