some tests for doc_atomic_add
Updated and used test/doc-extract.py
Cleanups and validation
const-correctness and documentation fixes