factor out logic for getting a domain and fix error with getting domain of url with no slash at end, also make blocking and is_blocked richer
factor out logic for getting a domain and fix error with getting domain of url with no slash at end, also make blocking and is_blocked richer

oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk