Improve URL parser to allow missing hostname/dbname

When parsing the URL "jdbc:postgresql:" (which is valid, or any invalid URL as well) URL parser would crash on line 41 trynig to get PGHOST from the map.  Fixed this, and also improved the parser to allow more valid URLs that are missing the host or dbname part.