Use URI to build URIs and hostname= to wrap ipv6 addresses in brackets.

See: https://bugs.ruby-lang.org/issues/3788
Related: https://www.ietf.org/rfc/rfc2732.txt
Merge pull request #16 from jrafanie/use_uri_and_uri_hostname_equals_to_build_uris

Use URI to build URIs and hostname= to wrap ipv6 addresses in brackets.