Completed porting of Replication.

Also includes implementation of network reachability.