Huge refactoring, replication_initial_copy and replication_start_slave for replication