Percent encoding

Current implementation of path percent encoding was not correct in many cases (a lot of special characters were not encoded).  Implemented new one and added tests for  new method.