Added a few basic unit tests and some documentation

Right. But I'm not sure that that would be so obvious to a user of the API, what do you think?