Adding hidden input for storing referrer link
Adding referrer data to template
Redirect now looks for a referrer, defaults to '/'
Removing unreachable code