histfactory: write_measurement improvements and docs