S3 proxying & metadata in postgres

- [x] fill in the rest of this
- [x] no really, this place is a mess
I think we should add the row id as well.