Adapted to new API

* use friend_id where appropriate
* use lowercase for string buddy id's
* get rid of global connection handle