Added s3 support. Fixes #1