Added code to catch and remove any / from URI path elements.

Changed how URI path has path separators removed to be once the URI is parsed,
rather than when it is received by the application.
Merge pull request #581 from rnicoll/1.7.2-dev-uri2

Remove any / from the end of a URI