Added a function for listing directories, and hopefully finished off the http/https switcher