Unify slave/master replication state in one mmap file;Original master change to slave for original slave without fullresync;Some improvements on replication