Cleanup, add commenting, and sanity checking

Added some sanity checking to the linkcheck code, as well as comments.
Changed the inline regex instantiation to finals with names that make
more sense on what exactly the regex is for.