Cleanup the BTree logic so it does not use global calls

Also made some methods private and added comments.
SERVER-12064 SERVER-12283 Use gcc atomic builtins if available

Switch to using gcc atomic builtins for atomic operations if using a new
enough gcc and clang and support is available. Otherwise, fall back to
the old behaviour of existing non-portable inline assembly to continue
to support builds on older versions of gcc.

Signed-off-by: Benety Goh <benety@mongodb.com>
SERVER-13797 Abstract $where processing and remove usages of getContext
SERVER-13635: pull out interface for deleting records in capped collection during rollover
SERVER-13635: pull out MAdvise interface, prove capped collection can compile in unit test
SERVER-13640: first trivial capped collection unit test
SERVER-13635: ExtentManager::cacheHint docs
SERVER-13754 explode OR solutions for sort
SERVER-13890 index bounds builder should not pass already-constructed intervals to translate()
SERVER-13892: Compiler Fixes
Merge remote-tracking branch 'upstream/master'