Refactor and test config-router-util.