Changed application's url_for and redirect to accept optional request parameters to make future changes easier.