S3 file server multi bucket and cache sync support

Big refactor of the S3 file server. Now it supports:
  * multiple buckets per environment (eg. `production = s3://myproduction`, `staging = s3://mystaging`) 
  * a single bucket with directories per environment in the buckets root directory (eg. `s3://mybucket/{production,staging}`).
  * also now syncs the local cache on 'update()' instead of just-in-time downloading.

Plus a bit of a clean up too.