Merging the S3 work

This needs to be reviewed and tested before we merge this pull request