Add BaseYamlStore.

This does the reading/writing logic that's common to the other
stores.