Move to Patrick clang fixes for cms thread safety attributes.
Misc cleanups.
Merge pull request #626 from ktf/new-clang

New clang