Script refactor

This is a complete rewrite of the script to make it run a little cleaner.

Major changes, other than superficial ones:
* integrate changes from this repo and the file that @mwobensmith sent me
* use HEAD requests rather than GET to save a little time and network usage
* write to the file continuously, and in the same order that the original hosts were listed
* stability tweaks of various sorts

I've been using this for testing compatibility on changes to libssl.  This seems to be used here for pkix changes.  Both seem to be fairly compatible goals.