reserve lower half of client lists for ipv4 for now

also rename client_in_list() to client_or_ip_port_in_list(), it also checks for an identical ip/port and replaces the client_id, recycling the entry

DHT.c:
- rename client_in_list() to client_or_ip_port_in_list()
- replace_bad(), replace_good(): if IPv6, only insert into the upper half of the given list
- addto_lists(): convert ipv4-in-ipv6 mapped to ipv4
reserving 50%+ for ipv4, take 2

DHT.c:
- we have to actually count the number of addresses in the field, because sort_list() will move the stuff around
- improved replace_good() substantially by throwing away the "furthest" client_id, not the one just a bit worse than the new one (but better than all the later ones in the field!)
Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core.git into ipv6.yield50%toipv4
honor the claim of sort_list(), that the result is in anti-intuitive order, and treat element zero as the furthest
moved stuff that belongs into ping.[ch] there

DHT.*, ping.*:
- moved stuff from struct DHT into struct PING: toping, last_toping
- moved functions add_toping(), do_toping()
- made id_closest() publicly accessible
- send_ping_request(): killed (Net_Crypto *c) parameter in favor of copying it into (PING *) on new_ping()

group_chats.c:
- killed local 1:1 copy in favor of DHT.c::id_closest()
Change tox_get_friendlist API.
tox_get_friendlist() -> tox_copy_friendlist().
You now have to allocate your own memory to pass into tox_copy_friendlist.
To help with this, tox_count_friendlist() has been added to get the length
of the friend list.
Fixed the connection bug and cleaned up some stuff.
Merge pull request #590 from FullName/ipv6.yield50%toipv4

reserve half of client lists for ipv4 (take #2)
Merge pull request #600 from Jman012/master

Fixed a bug or two.
Merge branch 'patch-9001' of https://github.com/stal888/ProjectTox-Core into stal888-patch-9001
Keep the code consistent.
Removed unused variables.
Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core
Fix inet_pton/ntop on win32
Merge branch 'win_inetpton' of https://github.com/BtbN/ProjectTox-Core
Astyled network.c
Fix typo. "if (yesno != 0 || yesno != 1)" always true
Merge pull request #601 from maksqwe/master

Fix typo. "if (yesno != 0 || yesno != 1)" always true
A markdown-formatted file had the .txt extension
Merge pull request #602 from davidgumberg/groupchat

A markdown-formatted file had the .txt extension