Moved around some includes to make sure definitions are in place for compiler feature detection.