Strip the port from the supplied host before looking up in the hostname map.
Merge remote-tracking branch 'bigkevmcd/hostmux-with-port'

This is exactly bigkevmcd's patch but I reordered the code in the files
and made the names of the tests clearer.