Now uses socket.create_connection.

This should enable the bot to support IPv6. Also fixed logging in main
function.