Some cleanups

Hi,

I did some cleanups for integrating with other client libraries, in case you'd like it to stay updated.

Asgeir