Fix macro feature check
Add missing std includes
Don't assume the leading cert chain is presented in-order
Missing include for std::to_string, noticed with Clang 3.4 w/ libc++