implemented toUri with endpoint

added tests and minor changes in the way s3path are build