add_doc(): now accepts tuples (term,value)