In-code API docs

This is my attempt to create API docs for chili (I guess it could be merged into one commit).
It's not complete, but it's something to start with.

Docs can be generated by using ldoc (check the .sh file, which can also be removed I guess).
Thoughts?