Factor out S3 config functionality to a class with static methods.

To make it easier to call from other code.  Also, add a couple
utility methods to call from RemoteApi.