Fix URL handling

Current implementation doesn't allow URLs with port (i.e.: http://domain.com:8080/path
Fix missing headers variable
Merge pull request #15 from rs/fix-host-with-port

Fix URL handling - thanks!