docs: Document the API

Made them in Markdown, so I can reuse them for the website with as few
modifications as possible.

This fixes #5.