Minor fixes to request_uri

Hey just letting you know of the changes:
-Made the request_uri func conformant to http://tools.ietf.org/html/rfc3986#section-3.3, not url-encoding characters that are allowed in the path segment (better explained here: http://stackoverflow.com/questions/4669692/valid-characters-for-directory-part-of-a-url-for-short-links)
-Added a quick unit test of the above
-As an optimization, only create REQUEST_URI manually if it isn't set by WSGI container.