Unquoted and quoted each part of the url in smart_urlquote() and added more tests.