Break out the URL terminator for mh-urls

I thought I was parsing a URL incorrectly but it turns out it's just
malformed.  As a side effect I was going to make the URL parser more
complicated, so I ended up with a function here I figure it doesn't
hurt, so I might as well leave it it.