Replication manager changes

The Java for-each loop has a nicer syntax and makes the code more idiomatic, please see http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html