Add support for IPv6 (updated) and clean up socket.cpp

This is an updated version of #365 based off the current master (at the time of the submission of this pull request).

Two new configuration options are added:
 * ```enable_ipv6``` to enable/disable the overall use of IPv6
 * ```ipv6_server``` to enable/disable the use of IPv6 sockets when running a server (when ```enable_ipv6``` is enabled)

Unlike the original version, IPv6 is NOT disableable at compile time.  Furthermore, I removed the useless GUI checkbox that nobody wanted and in retrospect was silly.

Finally, I also cleaned up and polished socket.cpp (in a separate commit) to make it more readable and to remove the commented-out debugging cruft.  This commit should be considered optional.

I have tested this on Linux.  It has NOT been tested on Windows.  If somebody could test this on Windows it would be greatly appreciated.