Just trying to recreate something like urlparse