Refactors function to get domain name
Adds functions to retrieve root url (without query string) and path