Broaden use of doc_extract code, put in ccanlint, and fix ccanlint