Now the root location is URI-encoded too. In order to properly test this change the root location in the tests was changed from "/ROOT" to "/ROOT#?" (or "/ROOT%23%3F" in URI-encoded form), which is why this commit is so big.