Adds S3 endpoint selection option

See diffs for detailed information on changes.