Fixed support for hostless paths

Fixed issue where a path like http://example.com would return 'self' as
path
Allow hostnames with sub/sub/* domains

The expression to test for domain names was restricted to two domain
parts + top level domain, fixed to allow for multiple sub domains