Properly lower-case host before checking for default port
Add some tests for https
This fixes issue #8