X509 vfy continued

Builds on @lvh's work in #1156. Let's see if jenkins is okay with it.
Will comments in this style make Windows compiler mad?