First working version

Hi guys,

This is a pull request for a first working version of this lib.
It could do with some more tests.

Wijnand