Refactor test tool parameter building.

This also adds support for separate hostnames for control and data
connections, and for specifying local listen addresses.