Use btcd/btcwallet-style config parsing and connect on correct port.

This copies the functionality of btcd and btcwallet for opening and
parsing a config file and command-line flags.  A --mainnet flag
(currently disabled) has been added so btcgui knows which network it
is intended to be running on.  More checks must be added later using
this new information (for example, only connecting to a btcwallet
operating on the same bitcoin network and checking that send-to
addresses use the correct network).

While fixing the hardcoded ports, net.JoinHostPort is now used so IPv6
support can be easily added in the future.