Added HTTPS support and moved the main site monitor into libs

Added HTTPS support and moved the main site monitor into libs