docs(lib): document the API

closes #20
Merge pull request #24 from japaric/docs

docs(lib): document the API