API documentation

This includes a rough, prosaic API documentation. It's not the most
comprehensive thing out there, but it gets the job done.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>