Optimize string convertion.

We determine when to cut off the string before using
creating an instance of a string.
Use ToxHandle.
Move friend specific functions to ToxFriend.