Handle $redirect to a route with parameters

Test $redirect by trying to match it to a route, which enables passing $redirect that contains parameters. If match() returns NULL then we assume the $redirect parameter contains a named route, as was the case prior to this commit.
That's what it used to be before being "fixed" to avoid the security problem of being passed a url to an external site. See discussion thread on this file in the master branch.