storage-related changes

A variety of changes/improvements/fixes that I've been doing in a big "storage" feature branch. However, that's been taking too long so this is an attempt to pull out some of those changes for two reasons:

1. if these can be merged, then risk of later conflicts are reduced
2. it'll make the big feature PR a bit smaller, when it's eventually ready.