Added more routing functionality.

Added more routing functionality so when a URL has a trailing forward
slash it is removed and if a match is found in the database it is
redirected to that URL.