Simplified smart_urlquote and added some basic tests.