Whitespace: tabs to spaces
Wrap legfile.save in a transaction so that no files are saves without their metadata if something goes wrong
Handle the case where a LegislationIndex is updated before the legislation's metadata is created.