Refactored S3 using AWS library and update with new filer API

@humphd if you can take a good look at this function would be great because this is the one that take time the most.