Adding some more tests

Also fixed a small issue that would cause the router to produce
inconsistent URL when rewriting strings. They sometimes were produced
with or without a starting slash.