"/" in the uri must never be urlencoded, it breaks opening files completely.
also remove some code repetition.
Merge pull request #59 from bifek/fix10

"/" in the uri must never be urlencoded