Simplify S3 helper.

Use S3 library to fetch the content length.
Remove unused memoization code.