S3 proxying & metadata in postgres

- [x] fill in the rest of this
- [x] no really, this place is a mess