API rebuild

Change several major points of the API Design:

1) We now have a friends class, and we are keeping a global Map that maps tox instances to their list of active friends. All calls on these friends are synchronized with the same Lock also used on the Tox instance which the
friends belong too, to ensure serial access and not mix up reads/writes.

2) Separate the validPointers Map into 2 Maps and 1 List. The maps contain the mappings between the pointers and friends/locks, while the list is the ultimate authority on which pointers are valid, and which pointers aren't.

3) Several minor Bugfixes for things which could possibly result in non-initialized variables