lib.[ch]: Add documentation and commentary.