Changes:

Improved layout of written HTML document,
If download folder does not exist, make it. Otherwise, start the
download,
Converted non-HTML file writing to use recommended `with` handle