Better detection of some c++11 support.
Moved around some includes to make sure definitions are in place for compiler feature detection.