Added HTTPS and lots of bug fixes
Merged from origin