Added bbcode_doc_destroy for freeing document.