Add Target::to_string()/from_string()/merge_string()

Refactor parse_target_string() so that the core is in the new
Target::merge_string() method, allowing us to cleanly parse target
strings without starting from get_host_target(). parse_target_string()
is now implemented using merge_string(), and has the same semantics
*except* that the “host” token is now supported only in the first
position in the string.

Also added to_string() to allow roundtripping or debugging, and a new
test case for the methods.