Update S3 FileSystem

This is an updated version of #1044.