Refactoring and cleanup.
Merge pull request #8 from Ayrx/master

HTTPS fix and code cleanup