add support for CApath

capath for relatively small cert sets (~300) makes scanning about 5%
faster

also do a little clean up of the command-to-run generation code
add some coimments, group related code
add caching of intermediate CA certificates
add ability to also save leaf certificates and untrusted ones
use CApath for certificates and store certificates

CApath is about 20% faster than CAfile so use it, also
save the recived certificates from the servers for later analysis
(proper hostname checking, looking for certificates sharing private key,
etc.)