Move calculation of normalised uri to the codepath where it is actually used - this fixes a bug in the mako-render script which refuses to process a filename that is given as a relative path