Multitude of fixes

Making a slew of changes to the source without really changing functionality all in the good purpose of keeping the source logic tight and easier to the eyes.

Also the `https://` URLs can't be used for downloading through `file_get_contents()` if the OpenSSL extension is not loaded with PHP.