Change the url matcher logic

And use some tests for the route matcher